document.getElementById("resetForm").addEventListener("submit", function(event) {
    // 获取新密码和确认新密码的值
    var newPassword = document.getElementById("newPassword").value;
    var confirmPassword = document.getElementById("confirmPassword").value;

    // 验证新密码和确认新密码是否为空
    if (newPassword === "") {
        document.getElementById("newPasswordError").textContent = "新密码不能为空";
        event.preventDefault();
        return false;
    } else {
        document.getElementById("newPasswordError").textContent = "";
    }

    if (confirmPassword === "") {
        document.getElementById("confirmPasswordError").textContent = "确认新密码不能为空";
        event.preventDefault();
        return false;
    } else if (confirmPassword !== newPassword) {
        document.getElementById("confirmPasswordError").textContent = "两次输入的密码不一致";
        event.preventDefault();
        return false;
    } else {
        document.getElementById("confirmPasswordError").textContent = "";

        // 提交新密码到本地数据库
        // 这里需要根据你自己的数据库进行修改
        // var db = openDatabase(...);
        // db.transaction(function(tx) {
        //     tx.executeSql('UPDATE users SET password = ? WHERE username = ?', [newPassword, username]);
        // });

        return true;
    }
});